<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <div th:replace="base(title='个人中心')"></div>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Demo</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li><a th:href="@{/}">首页</a></li>
                <li><a href="#">测试1</a></li>
                <li><a href="#">测试2</a></li>
            </ul>
            <form class="navbar-form navbar-right" th:action="@{/logout}" method="post">
                <a sec:authorize="hasRole('ADMIN') OR hasRole('SYSTEM_ADMIN')" th:href="@{/admin}" class="btn btn-primary">后台管理</a>
                <input type="submit" class="btn btn-danger" value="注销">
            </form>
        </div>
    </div>
</nav>
<div class="container-fluid">
    <br/>
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="alert alert-success" role="alert">
                <span th:text="${#httpServletRequest.getUserPrincipal().getName()}"></span>，欢迎你！
            </div>

            <div class="alert alert-danger" role="alert">
                <h4>你的角色或权限：（授权后需重新登录或重启应用）</h4>
                <div th:each="authority : ${authorities}">
                    <p th:text="${authority.getAuthority().toString()}"></p>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

